|
|
|
|
|
|
|
When you click the Help button, it retrieves the last two parameters so that it knows which Help file to display and which Help context ID within that Help file to show. The Help context ID is a unique number that corresponds to a particular page in your help file for this application. |
|
|
|
|
|
|
|
|
The InputBox() function creates a modal dialog box that can be used to retrieve one piece of information from a user. Instead of having to create your own custom dialog box to ask the user for a piece of information, you can utilize this built-in dialog box. |
|
|
|
|
|
|
|
|
Examples Filename: InputBox.frm |
|
|
|
|
|
|
|
|
InputBox() enables you to enter a caption, a title, and a default value for the input box, and it even allows you to position the input box to a certain location on the screen. In its simplest form, you can call the InputBox() function with just one parameter, as shown in the following code, to have an input box show up like the one in Figure 11.5. |
|
|
|
 |
|
|
|
|
Private Sub cmdSimple_Click()
Dim strName As String
strName = InputBox("Enter an Employee Name") MsgBox "You input " & strName
End Sub |
|
|
|
|
|
|
|
|
In the cmdSimple_Click() event, you need to declare a variable, strName, to hold the value that will come back from the InputBox() function. This string is the value the user types into the text box in the input box. If the user presses the Cancel button, a blank string is returned. |
|
|
|
|
|
|
|
|
Figure 11.5
A simple input box. |
|
|
|
|
|